package com.supermarket.api.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品表
 * @author 李其伟
 * @date 2023/10/19
 */
@Data
@Entity
@Table(name = "sm_product")
@org.hibernate.annotations.Table(appliesTo = "sm_product",comment="商品表")
public class ProductEntity extends BaseEntity {


    @Column(name = "sku", columnDefinition = " char(64) not null unique comment '商品货号' ")
    private String sku;
    @Column(name = "category_id", columnDefinition = " bigint(20) comment '分类主键' ")
    private Long categoryId;
    @Column(name = "shop_id", columnDefinition = " bigint(20) comment '店铺主键' ")
    private Long shopId;

    @Column(name = "title", columnDefinition = " varchar(256) comment '商品标题' ")
    private String title;
    @Column(name = "sub_title", columnDefinition = " varchar(512) comment '商品副标题' ")
    private String subTitle;
    @Column(name = "pic", columnDefinition = " varchar(512) comment '图片' ")
    private String pic;
    @Column(name = "album_pics", columnDefinition = " varchar(2048) comment '画册图片，限制为5张，以逗号分割' ")
    private String albumPics;
    @Column(name = "keywords", columnDefinition = " varchar(256) comment '关键字' ")
    private String keywords;
    @Column(name = "detail_html", columnDefinition = " varchar(2048) comment '产品详情网页内容' ")
    private String detailHtml;

    @Column(name = "delete_status", columnDefinition = " int(11) comment '删除状态：0->未删除；1->已删除' ")
    private Integer deleteStatus;
    @Column(name = "publish_status", columnDefinition = " int(11) comment '上架状态：0->下架；1->上架' ")
    private Integer publishStatus;
    @Column(name = "audit_status", columnDefinition = " int(11) comment '审核状态：0->未审核；1->审核通过；2->审核未通过' ")
    private Integer auditStatus;
    @Column(name = "audit_remark", columnDefinition = " varchar(512) comment '审核备注' ")
    private String auditRemark;

    @Column(name = "sale", columnDefinition = " int(11) comment '销量' ")
    private Integer sale;
    @Column(name = "price", columnDefinition = " decimal(10, 2) comment '价格' ")
    private BigDecimal price;

    @Column(name = "sort", columnDefinition = " int(11) comment '排序' ")
    private Integer sort;

    @Column(name = "publish_time", columnDefinition = " datetime comment '上架时间' ")
    private Date publishTime;
    @Column(name = "update_time", columnDefinition = " datetime comment '修改时间' ")
    private Date updateTime;

}
